Skip to content

Tests: Fix improper async sortable test #1630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

leobalter
Copy link
Member

Caught when testing jQuery UI against the new QUnit version, where start throws an error if called with a non-numeric error.


I also tried this approach without the setTimeout, but it failed:

asyncTest( "#7415: Incorrect revert animation with axis: 'y'", function() {
  expect( 2 );
    var expectedLeft,
        element = $( "#sortable" ).sortable( {
            axis: "y",
            revert: true,
            stop: animationStop,
            sort: function() {
                expectedLeft = item.css( "left" );
            }
        } ),
        item = element.find( "li" ).eq( 0 );

    item.simulate( "drag", {
        dy: 300,
        dx: 50
    } );

    function animationStop() {
        var top = parseFloat( item.css( "top" ) );
        equal( item.css( "left" ), expectedLeft, "left not animated" );
        ok( top > 0 && top < 300, "top is animated" );
        start();
    };
} );

Caught when testing jQuery UI against the new QUnit version, where start throws
an error if called with a non-numeric error.
@scottgonzalez
Copy link
Member

Thanks!

@leobalter leobalter deleted the fix-async-test branch October 27, 2015 18:21
scottgonzalez pushed a commit that referenced this pull request Jun 9, 2016
Caught when testing jQuery UI against the new QUnit version, where start throws
an error if called with a non-numeric error.

Closes gh-1630

(cherry picked from commit 60fa118)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants